<?php

use Jialeo\LaravelSchemaExtend\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class InitAgentLevel extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('agent_levels', function (Blueprint $table) {

            $table->comment = '分销员等级表';

            $table->increments('id');
            $table->uuid('uuid')->index();

            $table->integer('level')->index()->comment('等级数值'); // 用户id 所得佣金

            $table->boolean('is_preset')->default(0)->index()->comment('0为非系统预设 1为系统预设'); // 用户id 所得佣金

            $table->string('title', 50)->comment('等级名称'); // 用户id 所得佣金

            // $table->string('brokerage_type', 20)->index()->comment('团队长'); // 用户id 所得佣金

            $table->text('description')->nullable()->comment('等级描述'); // 用户id 所得佣金

            $table->json('brokerage_setting')->nullable()->comment('佣金配置'); // 用户id 所得佣金

            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('agent_levels');
    }
}
